﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data.Objects;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
using System.Web.Services.Protocols;
using System.Web;

namespace EADCA3WebService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "RestaurantService" in code, svc and config file together.
    public class RestaurantService : IRestaurantService
    {
        public List<Restaurant> DisplayByCategory(string category)
        {
            // db refers to the connection to the database
            restaurantEntities db = new restaurantEntities();

            // Query the database to find all restaurants with a cuisine category matching input parameter
            var cuisineQuery = db.Restaurants
                                     .Where(r => r.Category == category); 
               
            return cuisineQuery.ToList();    
        }
    }
}
